import courseData from '../../../data/course';
import cartData from '../../../data/cate';
import Render from './Render'
export default class Course {
    constructor(oList, observer) {
        this.oList = oList;
        this.observer = observer
        this.cartData = cartData;
        this.courseData = courseData;
        this.init();
    }
    init() {
            this.formatData();
            new Render(
                this.oList,
                this.courseData,
                this.cartData,
                this.observer
            );
        }
        //给数据一个状态，是否存在待报名课程中
    formatData() {
        this.courseData = this.courseData.filter(item => {
            item.state = 0
            this.cartData.forEach(element => {
                if (item.id === element.id) {
                    item.state = 1
                }
            });
            return true
        })
    }
}